package com.talos.service.codegen;

public class PomContent {

    private static final String PROJECT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
            "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
            "    <modelVersion>4.0.0</modelVersion>\n" +
            "\n" +
            "    <parent>\n" +
            "        <groupId>com.yunbao</groupId>\n" +
            "        <artifactId>yunbao-parent</artifactId>\n" +
            "        <version>3.0.0-SNAPSHOT</version>\n" +
            "        <relativePath/>\n" +
            "    </parent>\n" +
            "\n" +
            "    <artifactId>{{projectName}}</artifactId>\n" +
            "    <version>3.0.0-SNAPSHOT</version>\n" +
            "    <packaging>pom</packaging>\n" +
            "\n" +
            "    <!--  请勿随意调整顺序  -->\n" +
            "    <modules>\n" +
            "        <module>{{baseName}}-entity</module>\n" +
            "        <module>{{baseName}}-generator</module>\n" +
            "        <module>{{baseName}}-service</module>\n" +
            "        <module>{{baseName}}-web</module>\n" +
            "    </modules>\n" +
            "</project>\n";

    private static final String ENTITY = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
            "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
            "    <modelVersion>4.0.0</modelVersion>\n" +
            "\n" +
            "    <parent>\n" +
            "        <groupId>com.yunbao</groupId>\n" +
            "        <artifactId>{{projectName}}</artifactId>\n" +
            "        <version>3.0.0-SNAPSHOT</version>\n" +
            "    </parent>\n" +
            "\n" +
            "    <artifactId>{{baseName}}-entity</artifactId>\n" +
            "    <version>3.0.0-SNAPSHOT</version>\n" +
            "    <packaging>jar</packaging>\n" +
            "\n" +
            "    <dependencies>\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>yunbao-parent-core</artifactId>\n" +
            "        </dependency>\n" +
            "    </dependencies>\n" +
            "</project>\n";

    private static final String SERVICE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
            "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
            "    <modelVersion>4.0.0</modelVersion>\n" +
            "\n" +
            "    <parent>\n" +
            "        <groupId>com.yunbao</groupId>\n" +
            "        <artifactId>{{projectName}}</artifactId>\n" +
            "        <version>3.0.0-SNAPSHOT</version>\n" +
            "    </parent>\n" +
            "\n" +
            "    <artifactId>{{baseName}}-service</artifactId>\n" +
            "    <version>3.0.0-SNAPSHOT</version>\n" +
            "    <packaging>jar</packaging>\n" +
            "\n" +
            "    <dependencies>\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>{{baseName}}-constant</artifactId>\n" +
            "            <version>${yunbao.version}</version>\n" +
            "        </dependency>\n" +
            "\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>{{baseName}}-enums</artifactId>\n" +
            "            <version>${yunbao.version}</version>\n" +
            "        </dependency>\n" +
            "\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>{{baseName}}-feign</artifactId>\n" +
            "            <version>${yunbao.version}</version>\n" +
            "        </dependency>\n" +
            "\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>{{baseName}}-entity</artifactId>\n" +
            "            <version>${yunbao.version}</version>\n" +
            "        </dependency>\n" +
            "\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>yunbao-parent-service</artifactId>\n" +
            "        </dependency>\n" +
            "    </dependencies>\n" +
            "</project>\n";

    private static final String WEB = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
            "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
            "    <modelVersion>4.0.0</modelVersion>\n" +
            "\n" +
            "    <parent>\n" +
            "        <groupId>com.yunbao</groupId>\n" +
            "        <artifactId>{{projectName}}</artifactId>\n" +
            "        <version>3.0.0-SNAPSHOT</version>\n" +
            "    </parent>\n" +
            "\n" +
            "    <artifactId>{{baseName}}-web</artifactId>\n" +
            "    <version>3.0.0-SNAPSHOT</version>\n" +
            "    <packaging>jar</packaging>\n" +
            "\n" +
            "    <dependencies>\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>{{baseName}}-service</artifactId>\n" +
            "            <version>${yunbao.version}</version>\n" +
            "        </dependency>\n" +
            "\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>yunbao-parent-web</artifactId>\n" +
            "        </dependency>\n" +
            "\n" +
            "        <dependency>\n" +
            "            <groupId>org.springframework.boot</groupId>\n" +
            "            <artifactId>spring-boot-starter-test</artifactId>\n" +
            "            <scope>test</scope>\n" +
            "        </dependency>\n" +
            "\n" +
            "        <dependency>\n" +
            "            <groupId>junit</groupId>\n" +
            "            <artifactId>junit</artifactId>\n" +
            "            <scope>test</scope>\n" +
            "        </dependency>\n" +
            "    </dependencies>\n" +
            "\n" +
            "    <build>\n" +
            "        <finalName>${project.artifactId}</finalName>\n" +
            "        <plugins>\n" +
            "            <plugin>\n" +
            "                <groupId>org.springframework.boot</groupId>\n" +
            "                <artifactId>spring-boot-maven-plugin</artifactId>\n" +
            "            </plugin>\n" +
            "        </plugins>\n" +
            "    </build>\n" +
            "</project>\n";

    private static final String GENERATOR = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
            "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
            "    <modelVersion>4.0.0</modelVersion>\n" +
            "\n" +
            "    <parent>\n" +
            "        <groupId>com.yunbao</groupId>\n" +
            "        <artifactId>{{projectName}}</artifactId>\n" +
            "        <version>3.0.0-SNAPSHOT</version>\n" +
            "    </parent>\n" +
            "\n" +
            "    <artifactId>{{baseName}}-generator</artifactId>\n" +
            "    <version>3.0.0-SNAPSHOT</version>\n" +
            "    <packaging>jar</packaging>\n" +
            "\n" +
            "    <dependencies>\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>yunbao-parent-generator</artifactId>\n" +
            "        </dependency>\n" +
            "    </dependencies>\n" +
            "</project>\n";

    private static final String COMMON = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
            "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
            "    <modelVersion>4.0.0</modelVersion>\n" +
            "\n" +
            "    <parent>\n" +
            "        <groupId>com.yunbao</groupId>\n" +
            "        <artifactId>yunbao-parent</artifactId>\n" +
            "        <version>3.0.0-SNAPSHOT</version>\n" +
            "        <relativePath/>\n" +
            "    </parent>\n" +
            "\n" +
            "    <artifactId>{{modelName}}</artifactId>\n" +
            "    <version>3.0.0-SNAPSHOT</version>\n" +
            "    <packaging>pom</packaging>\n" +
            "\n" +
            "    <modules>\n" +
            "        <module>{{baseName}}-constant</module>\n" +
            "        <module>{{baseName}}-enums</module>\n" +
            "        <module>{{baseName}}-feign</module>\n" +
            "    </modules>\n" +
            "</project>\n";

    private static final String CONSTANT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
            "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
            "    <modelVersion>4.0.0</modelVersion>\n" +
            "\n" +
            "    <parent>\n" +
            "        <groupId>com.yunbao</groupId>\n" +
            "        <artifactId>{{modelName}}</artifactId>\n" +
            "        <version>3.0.0-SNAPSHOT</version>\n" +
            "    </parent>\n" +
            "\n" +
            "    <artifactId>{{baseName}}-constant</artifactId>\n" +
            "    <version>3.0.0-SNAPSHOT</version>\n" +
            "    <packaging>jar</packaging>\n" +
            "</project>\n";

    private static final String ENUM = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
            "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
            "    <modelVersion>4.0.0</modelVersion>\n" +
            "\n" +
            "    <parent>\n" +
            "        <groupId>com.yunbao</groupId>\n" +
            "        <artifactId>{{modelName}}</artifactId>\n" +
            "        <version>3.0.0-SNAPSHOT</version>\n" +
            "    </parent>\n" +
            "\n" +
            "    <artifactId>{{baseName}}-enums</artifactId>\n" +
            "    <version>3.0.0-SNAPSHOT</version>\n" +
            "    <packaging>jar</packaging>\n" +
            "</project>\n";

    private static final String FEIGN = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n" +
            "         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" +
            "    <modelVersion>4.0.0</modelVersion>\n" +
            "\n" +
            "    <parent>\n" +
            "        <groupId>com.yunbao</groupId>\n" +
            "        <artifactId>{{modelName}}</artifactId>\n" +
            "        <version>3.0.0-SNAPSHOT</version>\n" +
            "    </parent>\n" +
            "\n" +
            "    <artifactId>{{baseName}}-feign</artifactId>\n" +
            "    <version>3.0.0-SNAPSHOT</version>\n" +
            "    <packaging>jar</packaging>\n" +
            "\n" +
            "    <dependencies>\n" +
            "        <dependency>\n" +
            "            <groupId>com.yunbao</groupId>\n" +
            "            <artifactId>yunbao-parent-feign</artifactId>\n" +
            "        </dependency>\n" +
            "    </dependencies>\n" +
            "</project>\n";

    public static String getProject(String baseName, String projectName) {
        return PomContent.PROJECT
                .replaceAll("\\{\\{baseName}}", baseName)
                .replaceAll("\\{\\{projectName}}", projectName);
    }

    public static String getEntity(String baseName, String projectName) {
        return PomContent.ENTITY
                .replaceAll("\\{\\{baseName}}", baseName)
                .replaceAll("\\{\\{projectName}}", projectName);
    }

    public static String getService(String baseName, String projectName) {
        return PomContent.SERVICE
                .replaceAll("\\{\\{baseName}}", baseName)
                .replaceAll("\\{\\{projectName}}", projectName);
    }

    public static String getWeb(String baseName, String projectName) {
        return PomContent.WEB
                .replaceAll("\\{\\{baseName}}", baseName)
                .replaceAll("\\{\\{projectName}}", projectName);
    }

    public static String getGenerator(String baseName, String projectName) {
        return PomContent.GENERATOR
                .replaceAll("\\{\\{baseName}}", baseName)
                .replaceAll("\\{\\{projectName}}", projectName);
    }

    public static String getCommon(String baseName, String modelName, String projectName) {
        return PomContent.COMMON
                .replaceAll("\\{\\{baseName}}", baseName)
                .replaceAll("\\{\\{modelName}}", modelName)
                .replaceAll("\\{\\{projectName}}", projectName);
    }

    public static String getConstant(String baseName, String modelName, String projectName) {
        return PomContent.CONSTANT
                .replaceAll("\\{\\{baseName}}", baseName)
                .replaceAll("\\{\\{modelName}}", modelName)
                .replaceAll("\\{\\{projectName}}", projectName);
    }

    public static String getEnum(String baseName, String modelName, String projectName) {
        return PomContent.ENUM
                .replaceAll("\\{\\{baseName}}", baseName)
                .replaceAll("\\{\\{modelName}}", modelName)
                .replaceAll("\\{\\{projectName}}", projectName);
    }

    public static String getFeign(String baseName, String modelName, String projectName) {
        return PomContent.FEIGN
                .replaceAll("\\{\\{baseName}}", baseName)
                .replaceAll("\\{\\{modelName}}", modelName)
                .replaceAll("\\{\\{projectName}}", projectName);
    }

}
